package org.bee.service.ext;
import jakarta.annotation.Resource;
import org.bee.mappers.ext.PermissionExtMapper;
import org.bee.model.Permission;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PermissionExtService {
    @Resource
    private PermissionExtMapper permissionExtMapper;
    /**
     * 查用户拥有的接口权限
     * @param userId 用户id
     * @return 接口权限列表
     */
    public List<Permission> getPermissionByUserId(String userId){
        return permissionExtMapper.getPermissionByUserId(userId);
    }
    /**
     * 查角色拥有的接口权限
     * @param roleId 角色id
     * @return 接口权限列表
     */
    public List<Permission> getPermissionByRoleId(String roleId){
        return permissionExtMapper.getPermissionByRoleId(roleId);
    }
}
